package main

import (
	"fmt"
	"gitee.com/shaoninghouse/grun"
	"time"
)

func main() {
	nf := grun.NewNodeFunc(func(paramInterface interface{}, logMine *grun.LogMine) (bool, error) {
		for i := 0; i < 4; i++ {
			time.Sleep(1 * time.Second)
			logMine.Println(i)
		}
		return true, nil
	})
	tg := grun.NewTaskGraph()
	tg.RegisterFunc(nf)
	tg.Append(grun.NewNode("Test", nf, nil))
	fmt.Println(tg.Start(tg.Get()))
}
